DECLARE @SomeTable AS TABLE (ID INT, StartDate DATETIME, EndDate datetime)
INSERT INTO @SomeTable (ID, StartDate, EndDate ) VALUES (1,'2013-01-01','2013-03-01'), (2,'2013-03-01','2013-05-01')
SELECT st.* FROM @SomeTable st

;WITH
MinMaxDates AS --FINDS THE MINIMUM AND MAXIMUM DATE RANGES
(
	SELECT	MIN(st.StartDate) AS MinDate,
			MAX(st.EndDate) AS MaxDate
	FROM	@SomeTable AS st
),
RecursiveDateBuilder AS
(
	SELECT mmd.MinDate AS MonthDate FROM MinMaxDates mmd
	UNION ALL
	SELECT	DATEADD(MONTH,1,MonthDate) FROM RecursiveDateBuilder rdb WHERE DATEADD(MONTH,1, MonthDate ) <= (SELECT mmd.MaxDate FROM MinMaxDates mmd)
)
SELECT
	*
FROM
	@SomeTable AS ST
	CROSS JOIN RecursiveDateBuilder AS R
WHERE
	R.MonthDate BETWEEN ST.StartDate AND ST.EndDate
	